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

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

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

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

k = A("k")
e = B("e")
d = C("d")
l = D("l")
j = A("j")
m = A("m")
i = A("i")
h = B("h")

k.q = l
k.v = d
k.u = h
e.s = h
e.v = h
e.y = l
e.q = d
d.w = h
d.o = e
l.x = d
l.q = d
l.y = e
j.q = l
j.v = d
j.u = h
m.q = l
m.v = d
m.u = e
i.q = l
i.v = d
i.u = h
h.s = e
h.v = e
h.y = l
h.q = d
assert e.y.y.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.u: B = None
        self.txt = txt

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

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

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

k = A("k")
e = B("e")
d = C("d")
l = D("l")
j = A("j")
m = A("m")
i = A("i")
h = B("h")

k.q = l
k.v = d
k.u = h
e.s = h
e.v = h
e.y = l
e.q = d
d.w = h
d.o = e
l.x = d
l.q = d
l.y = e
j.q = l
j.v = d
j.u = h
m.q = l
m.v = d
m.u = e
i.q = l
i.v = d
i.u = h
h.s = e
h.v = e
h.y = l
h.q = d
assert e.y.y.y.x.txt == "d"