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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.w: A = None
        self.x: E = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

n = A("n")
c = B("c")
g = C("g")
b = D("b")
e = E("e")
d = C("d")
l = B("l")

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.w: A = None
        self.x: E = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

n = A("n")
c = B("c")
g = C("g")
b = D("b")
e = E("e")
d = C("d")
l = B("l")

n.v = c
n.t = g
n.o = l
c.p = n
c.w = e
g.s = b
g.t = e
b.t = n
b.w = n
b.r = e
b.x = e
b.o = e
e.u = d
e.w = b
e.y = n
d.s = b
d.t = e
l.p = n
l.w = e
assert d.t.y.v.txt == "c"