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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: F = None
        self.w: D = None
        self.p: C = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

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

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

k.s = f
k.r = h
k.q = e
c.p = l
c.x = i
e.s = g
e.z = b
d.v = g
b.u = l
b.s = h
b.w = d
b.q = d
b.t = d
b.p = e
h.z = f
h.x = f
l.u = b
l.s = h
l.w = d
l.q = d
l.t = d
l.p = e
i.u = l
i.s = h
i.w = d
i.q = d
i.t = d
i.p = g
g.s = e
g.z = i
f.p = l
f.x = l
assert g.s.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: F = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: F = None
        self.w: D = None
        self.p: C = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

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

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

k.s = f
k.r = h
k.q = e
c.p = l
c.x = i
e.s = g
e.z = b
d.v = g
b.u = l
b.s = h
b.w = d
b.q = d
b.t = d
b.p = e
h.z = f
h.x = f
l.u = b
l.s = h
l.w = d
l.q = d
l.t = d
l.p = e
i.u = l
i.s = h
i.w = d
i.q = d
i.t = d
i.p = g
g.s = e
g.z = i
f.p = l
f.x = l
assert g.s.z.s.txt == "h"