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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

c.p = m
c.t = l
c.o = e
l.o = c
l.q = a
k.r = i
k.w = i
k.t = m
k.o = a
k.u = e
a.y = m
a.x = i
a.t = e
a.r = k
e.u = m
e.q = l
i.w = e
m.p = c
m.t = l
m.o = e
assert e.q.o.p.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: B = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

c.p = m
c.t = l
c.o = e
l.o = c
l.q = a
k.r = i
k.w = i
k.t = m
k.o = a
k.u = e
a.y = m
a.x = i
a.t = e
a.r = k
e.u = m
e.q = l
i.w = e
m.p = c
m.t = l
m.o = e
assert e.q.o.p.o.u.txt == "m"