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

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

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

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

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

n = A("n")
d = B("d")
e = C("e")
a = D("a")
f = E("f")
l = D("l")
m = E("m")
h = D("h")
g = C("g")

n.p = h
n.t = d
n.q = f
d.z = h
d.t = g
d.y = e
d.s = n
e.v = n
e.y = m
e.w = l
e.s = l
a.z = n
a.x = n
f.q = n
f.x = n
f.y = d
f.v = e
l.z = n
l.x = n
m.q = n
m.x = n
m.y = d
m.v = e
h.z = n
h.x = n
g.v = n
g.y = m
g.w = a
g.s = a
assert f.y.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

n = A("n")
d = B("d")
e = C("e")
a = D("a")
f = E("f")
l = D("l")
m = E("m")
h = D("h")
g = C("g")

n.p = h
n.t = d
n.q = f
d.z = h
d.t = g
d.y = e
d.s = n
e.v = n
e.y = m
e.w = l
e.s = l
a.z = n
a.x = n
f.q = n
f.x = n
f.y = d
f.v = e
l.z = n
l.x = n
m.q = n
m.x = n
m.y = d
m.v = e
h.z = n
h.x = n
g.v = n
g.y = m
g.w = a
g.s = a
assert f.y.t.y.txt == "m"