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

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

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

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

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

c = A("c")
m = B("m")
d = C("d")
a = D("a")
k = E("k")
e = B("e")
b = E("b")

c.p = a
c.t = a
c.v = d
m.v = b
m.p = b
m.o = e
m.y = c
d.x = k
d.r = m
d.v = a
a.p = k
a.v = d
a.o = c
a.s = m
a.w = m
k.p = d
k.y = d
e.v = k
e.p = k
e.o = m
e.y = c
b.p = d
b.y = d
assert e.o.y.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

c = A("c")
m = B("m")
d = C("d")
a = D("a")
k = E("k")
e = B("e")
b = E("b")

c.p = a
c.t = a
c.v = d
m.v = b
m.p = b
m.o = e
m.y = c
d.x = k
d.r = m
d.v = a
a.p = k
a.v = d
a.o = c
a.s = m
a.w = m
k.p = d
k.y = d
e.v = k
e.p = k
e.o = m
e.y = c
b.p = d
b.y = d
assert e.o.y.p.v.txt == "d"