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

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

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

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

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

l = A("l")
j = B("j")
a = C("a")
k = D("k")
h = E("h")
e = A("e")
f = C("f")

l.q = j
l.t = k
l.v = e
j.o = a
j.y = l
j.x = f
a.t = k
a.o = l
a.s = e
k.x = e
h.z = l
h.s = l
e.q = j
e.t = k
e.v = l
f.t = k
f.o = e
f.s = l
assert e.q.o.t.x.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

l = A("l")
j = B("j")
a = C("a")
k = D("k")
h = E("h")
e = A("e")
f = C("f")

l.q = j
l.t = k
l.v = e
j.o = a
j.y = l
j.x = f
a.t = k
a.o = l
a.s = e
k.x = e
h.z = l
h.s = l
e.q = j
e.t = k
e.v = l
f.t = k
f.o = e
f.s = l
assert e.q.o.t.x.q.y.txt == "l"