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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: F = None
        self.x: A = None
        self.q: E = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

l = A("l")
b = B("b")
h = C("h")
g = D("g")
c = E("c")
e = F("e")
j = B("j")
a = E("a")
m = A("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: F = None
        self.x: A = None
        self.q: E = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

l = A("l")
b = B("b")
h = C("h")
g = D("g")
c = E("c")
e = F("e")
j = B("j")
a = E("a")
m = A("m")

l.s = h
b.r = c
b.t = g
b.x = l
b.u = j
b.z = e
h.u = c
h.p = l
g.y = l
g.t = l
g.u = j
g.z = j
g.s = e
g.q = b
c.z = h
c.s = e
c.p = e
c.y = e
c.x = l
c.q = a
e.x = a
e.t = h
j.r = c
j.t = g
j.x = m
j.u = b
j.z = e
a.z = h
a.s = e
a.p = e
a.y = e
a.x = l
a.q = c
m.s = h
assert b.t.u.t.txt == "g"