class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.w: B = None
        self.y: B = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.r: C = None
        self.y: D = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.t: A = None
        self.s: D = None
        self.z: D = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.p: A = None
        self.s: B = None
        self.z: B = None
        self.txt = txt

f = A("f")
n = B("n")
g = C("g")
c = D("c")
j = E("j")
e = F("e")

f.r = g
f.x = j
f.t = j
f.w = n
f.y = n
n.x = f
n.q = f
n.v = g
n.r = g
n.y = c
g.v = f
g.t = f
g.u = n
g.s = c
g.z = c
g.x = j
c.o = f
j.s = n
j.t = g
e.o = n
e.s = n
e.z = n
e.x = g
e.p = f
assert j.s.x.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.w: B = None
        self.y: B = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.r: C = None
        self.y: D = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.t: A = None
        self.s: D = None
        self.z: D = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.p: A = None
        self.s: B = None
        self.z: B = None
        self.txt = txt

f = A("f")
n = B("n")
g = C("g")
c = D("c")
j = E("j")
e = F("e")

f.r = g
f.x = j
f.t = j
f.w = n
f.y = n
n.x = f
n.q = f
n.v = g
n.r = g
n.y = c
g.v = f
g.t = f
g.u = n
g.s = c
g.z = c
g.x = j
c.o = f
j.s = n
j.t = g
e.o = n
e.s = n
e.z = n
e.x = g
e.p = f
assert j.s.x.r.u.txt == "n"