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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: A = None
        self.o: D = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

i.p = n
i.t = n
i.y = a
a.q = i
h.z = n
f.t = j
f.p = a
n.s = l
n.r = i
n.o = j
n.t = d
n.x = d
j.t = f
j.p = a
d.z = l
l.s = n
l.r = i
l.o = j
l.t = h
l.x = h
assert i.p.s.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: A = None
        self.o: D = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

i.p = n
i.t = n
i.y = a
a.q = i
h.z = n
f.t = j
f.p = a
n.s = l
n.r = i
n.o = j
n.t = d
n.x = d
j.t = f
j.p = a
d.z = l
l.s = n
l.r = i
l.o = j
l.t = h
l.x = h
assert i.p.s.s.x.txt == "d"