class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.r: D = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

k.o = h
k.t = g
k.w = f
k.q = c
d.u = m
i.s = m
b.s = d
b.z = d
b.p = f
b.q = g
b.u = k
h.t = i
h.o = i
m.u = c
m.q = i
m.o = i
m.y = i
m.r = g
c.o = h
c.t = b
c.w = k
c.q = k
f.o = h
f.t = g
f.w = k
f.q = c
g.s = d
g.z = d
g.p = k
g.u = k
g.q = b
assert i.s.u.t.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.r: D = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

k.o = h
k.t = g
k.w = f
k.q = c
d.u = m
i.s = m
b.s = d
b.z = d
b.p = f
b.q = g
b.u = k
h.t = i
h.o = i
m.u = c
m.q = i
m.o = i
m.y = i
m.r = g
c.o = h
c.t = b
c.w = k
c.q = k
f.o = h
f.t = g
f.w = k
f.q = c
g.s = d
g.z = d
g.p = k
g.u = k
g.q = b
assert i.s.u.t.q.u.txt == "k"