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

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

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

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

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

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

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

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

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

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

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

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

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

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

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