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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.v: C = None
        self.w: A = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.v: C = None
        self.w: A = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

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