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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.w: B = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

l = A("l")
a = B("a")
j = C("j")
e = D("e")
d = E("d")
g = F("g")
k = A("k")
n = D("n")

l.p = e
a.y = d
j.z = d
j.v = n
e.s = d
e.p = d
e.r = n
e.t = a
e.o = g
d.y = j
d.s = a
g.q = a
g.w = a
g.t = a
g.x = n
g.u = j
k.p = e
n.s = d
n.p = d
n.r = e
n.t = a
n.o = g
assert k.p.r.r.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.w: B = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

l = A("l")
a = B("a")
j = C("j")
e = D("e")
d = E("d")
g = F("g")
k = A("k")
n = D("n")

l.p = e
a.y = d
j.z = d
j.v = n
e.s = d
e.p = d
e.r = n
e.t = a
e.o = g
d.y = j
d.s = a
g.q = a
g.w = a
g.t = a
g.x = n
g.u = j
k.p = e
n.s = d
n.p = d
n.r = e
n.t = a
n.o = g
assert k.p.r.r.p.s.txt == "a"