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

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

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

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

a = A("a")
j = B("j")
b = C("b")
i = D("i")
k = C("k")
l = D("l")
e = D("e")
h = B("h")

a.t = j
a.q = k
a.w = k
a.s = i
j.q = b
b.s = h
b.v = j
b.x = k
b.y = k
i.t = l
i.p = k
k.s = j
k.v = h
k.x = b
k.y = b
l.t = i
l.p = k
e.t = l
e.p = b
h.q = b
assert j.q.v.q.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: C = None
        self.w: C = None
        self.s: D = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
b = C("b")
i = D("i")
k = C("k")
l = D("l")
e = D("e")
h = B("h")

a.t = j
a.q = k
a.w = k
a.s = i
j.q = b
b.s = h
b.v = j
b.x = k
b.y = k
i.t = l
i.p = k
k.s = j
k.v = h
k.x = b
k.y = b
l.t = i
l.p = k
e.t = l
e.p = b
h.q = b
assert j.q.v.q.s.q.txt == "b"