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

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: A = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
j = B("j")
k = C("k")
l = D("l")
b = E("b")
f = B("f")
n = C("n")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: A = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
j = B("j")
k = C("k")
l = D("l")
b = E("b")
f = B("f")
n = C("n")
c = D("c")

a.v = c
a.r = j
a.x = j
a.w = n
j.x = f
j.r = a
j.y = k
j.q = b
k.p = a
l.x = k
l.q = a
l.o = c
l.t = n
b.x = c
b.p = j
f.x = j
f.r = a
f.y = n
f.q = b
n.p = a
c.x = k
c.t = k
c.q = a
c.o = l
assert k.p.x.q.p.y.p.v.txt == "c"