class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: D = None
        self.t: D = None
        self.x: F = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.q: A = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

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

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

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

b = A("b")
a = B("a")
g = C("g")
n = D("n")
e = E("e")
h = F("h")
k = C("k")
c = C("c")
f = A("f")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.q: A = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

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

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

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

b = A("b")
a = B("a")
g = C("g")
n = D("n")
e = E("e")
h = F("h")
k = C("k")
c = C("c")
f = A("f")

b.q = f
b.z = n
b.t = n
b.u = n
b.p = n
b.x = h
a.p = g
a.r = h
g.o = n
g.u = c
g.q = b
g.z = h
g.p = e
n.s = a
n.z = e
e.r = f
e.u = a
h.r = b
k.o = n
k.u = c
k.q = f
k.z = h
k.p = e
c.o = n
c.u = k
c.q = b
c.z = h
c.p = e
f.q = b
f.z = n
f.t = n
f.u = n
f.p = n
f.x = h
assert h.r.q.p.s.r.r.x.r.txt == "b"