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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

c.o = d
c.q = k
c.u = l
c.p = m
l.x = k
d.p = l
d.x = m
d.v = m
d.q = m
e.w = k
e.z = i
k.x = m
k.o = i
k.t = d
m.w = c
m.u = l
i.x = k
assert m.w.p.u.x.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: E = None
        self.u: B = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

c.o = d
c.q = k
c.u = l
c.p = m
l.x = k
d.p = l
d.x = m
d.v = m
d.q = m
e.w = k
e.z = i
k.x = m
k.o = i
k.t = d
m.w = c
m.u = l
i.x = k
assert m.w.p.u.x.t.p.txt == "l"