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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.v: B = None
        self.z: C = None
        self.txt = txt

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

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

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

j.p = k
j.z = f
b.w = l
b.p = j
a.x = n
a.u = f
a.v = b
a.z = d
c.u = j
c.v = i
c.z = i
c.y = b
k.o = i
k.v = a
k.x = b
i.o = k
i.v = a
i.x = b
n.p = k
n.z = j
d.x = f
d.u = n
d.v = b
d.z = a
l.u = f
l.v = i
l.z = k
l.y = b
f.p = k
f.z = n
assert i.v.x.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.v: B = None
        self.z: C = None
        self.txt = txt

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

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

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

j.p = k
j.z = f
b.w = l
b.p = j
a.x = n
a.u = f
a.v = b
a.z = d
c.u = j
c.v = i
c.z = i
c.y = b
k.o = i
k.v = a
k.x = b
i.o = k
i.v = a
i.x = b
n.p = k
n.z = j
d.x = f
d.u = n
d.v = b
d.z = a
l.u = f
l.v = i
l.z = k
l.y = b
f.p = k
f.z = n
assert i.v.x.p.v.txt == "a"