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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.s: B = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

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

b.o = d
b.y = i
i.r = b
i.u = f
i.z = f
i.q = d
i.w = c
h.r = e
c.o = i
c.q = b
c.r = n
d.y = c
d.v = c
d.o = n
d.s = i
d.u = f
e.y = c
e.v = c
e.o = n
e.s = i
e.u = h
l.r = d
f.r = d
n.o = e
n.y = i
assert i.r.y.r.o.v.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.s: B = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

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

b.o = d
b.y = i
i.r = b
i.u = f
i.z = f
i.q = d
i.w = c
h.r = e
c.o = i
c.q = b
c.r = n
d.y = c
d.v = c
d.o = n
d.s = i
d.u = f
e.y = c
e.v = c
e.o = n
e.s = i
e.u = h
l.r = d
f.r = d
n.o = e
n.y = i
assert i.r.y.r.o.v.q.o.txt == "d"