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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

d.t = c
d.r = c
n.q = m
n.y = j
n.v = j
f.z = g
f.x = g
f.u = n
c.w = n
c.q = n
m.w = j
m.q = j
k.w = j
k.q = j
h.w = j
h.q = n
g.z = f
g.x = f
g.u = j
j.q = m
j.y = n
j.v = n
assert h.q.q.q.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

d.t = c
d.r = c
n.q = m
n.y = j
n.v = j
f.z = g
f.x = g
f.u = n
c.w = n
c.q = n
m.w = j
m.q = j
k.w = j
k.q = j
h.w = j
h.q = n
g.z = f
g.x = f
g.u = j
j.q = m
j.y = n
j.v = n
assert h.q.q.q.y.y.txt == "j"