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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

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

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

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