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

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

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

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

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

d = A("d")
e = B("e")
a = C("a")
h = D("h")
j = E("j")
g = D("g")
f = D("f")
m = C("m")
n = D("n")
c = D("c")

d.w = a
d.t = g
d.y = j
d.o = m
d.u = c
e.q = m
e.v = n
a.q = h
a.y = c
h.v = j
j.p = h
g.v = j
f.v = j
m.q = h
m.y = g
n.v = j
c.v = j
assert g.v.p.v.p.v.p.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.y: E = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

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

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

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

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

d = A("d")
e = B("e")
a = C("a")
h = D("h")
j = E("j")
g = D("g")
f = D("f")
m = C("m")
n = D("n")
c = D("c")

d.w = a
d.t = g
d.y = j
d.o = m
d.u = c
e.q = m
e.v = n
a.q = h
a.y = c
h.v = j
j.p = h
g.v = j
f.v = j
m.q = h
m.y = g
n.v = j
c.v = j
assert g.v.p.v.p.v.p.v.p.v.txt == "j"