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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.t: B = None
        self.u: C = None
        self.s: E = None
        self.txt = txt

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

c.p = a
c.x = a
c.z = n
c.w = m
c.r = j
f.z = b
f.v = c
f.p = e
f.o = e
l.t = n
l.x = m
m.y = n
e.x = l
e.u = l
e.p = b
e.s = b
e.t = f
j.y = l
a.p = c
a.x = c
a.z = n
a.w = j
a.r = j
n.t = l
n.x = m
b.x = l
b.u = l
b.p = e
b.s = e
b.t = h
h.z = e
h.v = a
h.p = b
h.o = b
assert f.v.r.y.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.w: D = None
        self.r: D = None
        self.x: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.t: B = None
        self.u: C = None
        self.s: E = None
        self.txt = txt

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

c.p = a
c.x = a
c.z = n
c.w = m
c.r = j
f.z = b
f.v = c
f.p = e
f.o = e
l.t = n
l.x = m
m.y = n
e.x = l
e.u = l
e.p = b
e.s = b
e.t = f
j.y = l
a.p = c
a.x = c
a.z = n
a.w = j
a.r = j
n.t = l
n.x = m
b.x = l
b.u = l
b.p = e
b.s = e
b.t = h
h.z = e
h.v = a
h.p = b
h.o = b
assert f.v.r.y.t.x.txt == "m"