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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.x: B = None
        self.v: F = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.x: B = None
        self.v: F = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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