class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.o: A = None
        self.w: B = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.o: A = None
        self.w: B = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

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

k.u = f
i.y = l
i.r = l
i.o = k
i.u = k
l.s = m
l.y = m
l.z = a
l.q = k
f.v = l
f.p = k
f.o = k
f.r = k
f.w = i
f.u = i
b.x = i
b.t = i
b.r = i
b.v = l
b.y = k
b.q = m
m.s = f
m.r = f
m.p = l
m.z = l
m.t = a
m.w = c
c.x = i
c.t = i
c.r = i
c.v = l
c.y = k
c.q = h
h.s = f
h.r = f
h.p = l
h.z = l
h.t = m
h.w = c
a.s = f
a.r = f
a.p = l
a.z = l
a.t = m
a.w = b
assert m.z.q.u.p.txt == "k"