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

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

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

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

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

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

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

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

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

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

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

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

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