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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
a = C("a")
k = D("k")
i = D("i")
f = A("f")
b = B("b")
d = C("d")

e.q = d
e.s = k
e.z = i
e.r = h
h.s = e
a.x = e
k.y = a
k.v = i
i.y = d
i.v = k
f.q = d
f.s = i
f.z = i
f.r = h
b.s = e
d.x = e
assert i.v.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: D = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
a = C("a")
k = D("k")
i = D("i")
f = A("f")
b = B("b")
d = C("d")

e.q = d
e.s = k
e.z = i
e.r = h
h.s = e
a.x = e
k.y = a
k.v = i
i.y = d
i.v = k
f.q = d
f.s = i
f.z = i
f.r = h
b.s = e
d.x = e
assert i.v.y.x.txt == "e"