#include <fstream>    
#include <iostream>
#include <string>

using namespace std;

int main()
{
	/*Create file stream reference*/
	fstream fs;
	/*Open the file for reading*/
	fs.open("test.txt", ios::in);
	/*create string variable for storage*/
	string tmp;
	/*Seek to the end of the file*/
	fs.seekg(0, ios::end);
	/*place the file pointer at the end of the file minus the number specified*/
	fs.seekp(static_cast<int>(fs.tellg()) - 20);
	/*get the last line from the currenyt offset and stop by the '\n' character*/
	getline(fs, tmp, '\n');
	/*close the file*/
	fs.close();
	/*output the found elements*/
	cout << tmp;
	return 0;
}