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

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

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

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

j = A("j")
e = B("e")
n = C("n")
h = D("h")
l = B("l")
a = C("a")
d = D("d")

j.y = a
j.w = l
e.v = a
e.x = l
n.y = a
h.z = d
h.q = l
h.t = n
l.v = n
l.x = e
a.y = n
d.z = h
d.q = e
d.t = n
assert d.q.x.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
n = C("n")
h = D("h")
l = B("l")
a = C("a")
d = D("d")

j.y = a
j.w = l
e.v = a
e.x = l
n.y = a
h.z = d
h.q = l
h.t = n
l.v = n
l.x = e
a.y = n
d.z = h
d.q = e
d.t = n
assert d.q.x.v.y.txt == "a"