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

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

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

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

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

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

h.q = l
h.p = d
j.r = f
j.w = f
j.s = d
c.y = d
a.v = l
a.z = c
e.v = a
e.o = l
e.z = c
d.v = a
d.o = c
d.z = l
l.y = d
f.r = j
f.w = j
f.s = e
assert d.z.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

h.q = l
h.p = d
j.r = f
j.w = f
j.s = d
c.y = d
a.v = l
a.z = c
e.v = a
e.o = l
e.z = c
d.v = a
d.o = c
d.z = l
l.y = d
f.r = j
f.w = j
f.s = e
assert d.z.y.z.y.txt == "d"