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

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

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

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

e = A("e")
i = B("i")
g = C("g")
n = D("n")
j = B("j")
m = D("m")
k = C("k")

e.p = m
e.s = n
e.q = g
e.y = j
i.s = k
i.x = g
i.t = m
g.o = m
n.x = m
n.s = g
n.q = g
j.s = g
j.x = g
j.t = m
m.x = n
m.s = k
m.q = g
k.o = n
assert m.q.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: D = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
g = C("g")
n = D("n")
j = B("j")
m = D("m")
k = C("k")

e.p = m
e.s = n
e.q = g
e.y = j
i.s = k
i.x = g
i.t = m
g.o = m
n.x = m
n.s = g
n.q = g
j.s = g
j.x = g
j.t = m
m.x = n
m.s = k
m.q = g
k.o = n
assert m.q.o.s.o.txt == "n"