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

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

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

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

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

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

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

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

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

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

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

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

n.v = b
n.p = e
n.y = k
j.w = e
j.q = c
j.x = l
k.y = b
k.s = b
k.o = c
k.q = n
k.v = g
b.y = l
b.r = n
e.o = k
e.r = n
e.p = n
e.y = n
g.w = e
g.q = c
g.x = l
l.y = b
l.r = n
c.y = l
c.o = k
c.q = n
c.v = j
c.s = b
assert k.q.y.v.w.txt == "e"