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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: F = None
        self.v: A = None
        self.t: D = None
        self.p: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: D = None
        self.s: F = None
        self.z: B = None
        self.u: F = None
        self.w: C = None
        self.txt = txt

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

h.r = b
f.z = j
f.x = k
b.t = a
b.z = a
b.u = f
b.q = f
l.z = f
l.q = c
l.v = h
l.s = h
l.t = g
l.p = b
a.q = b
k.t = b
k.w = b
k.y = l
k.s = c
k.u = c
k.z = f
j.q = b
n.q = b
c.t = b
c.w = b
c.y = g
c.s = k
c.u = k
c.z = f
g.z = f
g.q = k
g.v = h
g.s = h
g.t = l
g.p = b
assert h.r.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: F = None
        self.v: A = None
        self.t: D = None
        self.p: C = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: D = None
        self.s: F = None
        self.z: B = None
        self.u: F = None
        self.w: C = None
        self.txt = txt

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

h.r = b
f.z = j
f.x = k
b.t = a
b.z = a
b.u = f
b.q = f
l.z = f
l.q = c
l.v = h
l.s = h
l.t = g
l.p = b
a.q = b
k.t = b
k.w = b
k.y = l
k.s = c
k.u = c
k.z = f
j.q = b
n.q = b
c.t = b
c.w = b
c.y = g
c.s = k
c.u = k
c.z = f
g.z = f
g.q = k
g.v = h
g.s = h
g.t = l
g.p = b
assert h.r.u.x.txt == "k"