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

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

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

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

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

h = A("h")
e = B("e")
c = C("c")
b = D("b")
j = E("j")
d = D("d")

h.o = e
h.v = e
h.y = c
h.z = c
e.v = c
c.t = e
c.x = e
c.v = h
c.q = j
c.s = d
b.r = c
b.z = d
b.y = d
j.r = e
j.z = c
d.r = c
d.z = b
d.y = b
assert b.r.t.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

h = A("h")
e = B("e")
c = C("c")
b = D("b")
j = E("j")
d = D("d")

h.o = e
h.v = e
h.y = c
h.z = c
e.v = c
c.t = e
c.x = e
c.v = h
c.q = j
c.s = d
b.r = c
b.z = d
b.y = d
j.r = e
j.z = c
d.r = c
d.z = b
d.y = b
assert b.r.t.v.v.v.txt == "e"