#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main()
{
    
    int a = 5;
    ofstream wej( "a.txt" );
    ofstream wyj( "a.txt" );
    if( !wej ) cout << "blad";
    
    wej >> a;
    wyj << 7;
    cout << a;
    wej.close();
}