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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.x: B = None
        self.u: D = None
        self.p: E = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
b = C("b")
g = D("g")
e = E("e")
c = B("c")
l = E("l")
a = A("a")

h.y = f
h.q = c
h.t = b
f.r = l
b.z = h
b.v = a
b.x = c
b.u = g
b.p = e
g.s = l
g.y = b
g.r = c
g.o = f
e.o = c
e.w = g
c.r = e
l.o = c
l.w = g
a.y = f
a.q = c
a.t = b
assert a.t.v.t.x.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.x: B = None
        self.u: D = None
        self.p: E = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
b = C("b")
g = D("g")
e = E("e")
c = B("c")
l = E("l")
a = A("a")

h.y = f
h.q = c
h.t = b
f.r = l
b.z = h
b.v = a
b.x = c
b.u = g
b.p = e
g.s = l
g.y = b
g.r = c
g.o = f
e.o = c
e.w = g
c.r = e
l.o = c
l.w = g
a.y = f
a.q = c
a.t = b
assert a.t.v.t.x.r.o.r.txt == "e"