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

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

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

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

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

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

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

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

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

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

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

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

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

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

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