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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

f.p = c
f.y = a
f.x = e
h.t = a
h.y = n
h.p = c
h.s = d
c.r = a
n.p = k
l.p = d
l.s = d
l.r = n
l.w = a
l.t = f
a.t = h
a.y = n
a.p = c
a.s = l
k.p = c
k.x = c
k.y = h
d.p = l
d.s = l
d.r = n
d.w = a
d.t = f
e.r = a
assert n.p.y.s.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

f.p = c
f.y = a
f.x = e
h.t = a
h.y = n
h.p = c
h.s = d
c.r = a
n.p = k
l.p = d
l.s = d
l.r = n
l.w = a
l.t = f
a.t = h
a.y = n
a.p = c
a.s = l
k.p = c
k.x = c
k.y = h
d.p = l
d.s = l
d.r = n
d.w = a
d.t = f
e.r = a
assert n.p.y.s.t.y.t.txt == "h"