class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.s: A = None
        self.w: A = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
g = C("g")
b = D("b")
j = E("j")
a = E("a")
m = B("m")
c = A("c")
n = E("n")

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.s: A = None
        self.w: A = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
g = C("g")
b = D("b")
j = E("j")
a = E("a")
m = B("m")
c = A("c")
n = E("n")

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