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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

h = A("h")
b = B("b")
i = C("i")
d = D("d")
k = E("k")
n = F("n")
j = C("j")
l = E("l")
c = B("c")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

h = A("h")
b = B("b")
i = C("i")
d = D("d")
k = E("k")
n = F("n")
j = C("j")
l = E("l")
c = B("c")

h.t = n
b.s = c
b.y = c
b.q = k
b.t = k
b.z = j
i.r = l
i.s = k
i.t = n
d.y = k
d.p = b
k.p = d
k.t = d
k.w = l
k.u = l
k.v = n
n.y = d
j.r = l
j.s = k
j.t = n
l.p = d
l.t = d
l.w = k
l.u = k
l.v = n
c.s = b
c.y = b
c.q = k
c.z = i
c.t = l
assert j.s.u.p.txt == "d"