class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.p: C = None
        self.v: B = None
        self.u: F = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.p: C = None
        self.v: B = None
        self.u: F = None
        self.r: E = None
        self.txt = txt

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

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