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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

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

b = A("b")
a = B("a")
i = C("i")
f = D("f")
n = E("n")
m = C("m")
h = B("h")
k = A("k")
e = E("e")

b.p = e
b.x = e
a.v = e
a.q = f
a.z = b
i.w = k
i.p = k
f.p = a
f.u = k
f.s = k
f.y = m
n.y = e
n.u = f
m.w = b
m.p = b
h.v = e
h.q = f
h.z = k
k.p = n
k.x = n
e.y = n
e.u = f
assert k.x.u.y.p.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

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

b = A("b")
a = B("a")
i = C("i")
f = D("f")
n = E("n")
m = C("m")
h = B("h")
k = A("k")
e = E("e")

b.p = e
b.x = e
a.v = e
a.q = f
a.z = b
i.w = k
i.p = k
f.p = a
f.u = k
f.s = k
f.y = m
n.y = e
n.u = f
m.w = b
m.p = b
h.v = e
h.q = f
h.z = k
k.p = n
k.x = n
e.y = n
e.u = f
assert k.x.u.y.p.p.y.txt == "n"