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

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

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

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

e = A("e")
h = B("h")
j = C("j")
g = D("g")
f = D("f")
n = C("n")
a = A("a")
i = D("i")

e.x = j
e.t = f
e.p = n
h.v = a
h.o = a
h.p = f
j.p = n
j.t = i
j.y = e
g.t = e
g.y = h
g.u = i
f.t = a
f.y = h
f.u = g
n.p = j
n.t = f
n.y = e
a.x = n
a.t = f
a.p = j
i.t = a
i.y = h
i.u = f
assert n.y.x.y.p.y.p.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.p: C = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
j = C("j")
g = D("g")
f = D("f")
n = C("n")
a = A("a")
i = D("i")

e.x = j
e.t = f
e.p = n
h.v = a
h.o = a
h.p = f
j.p = n
j.t = i
j.y = e
g.t = e
g.y = h
g.u = i
f.t = a
f.y = h
f.u = g
n.p = j
n.t = f
n.y = e
a.x = n
a.t = f
a.p = j
i.t = a
i.y = h
i.u = f
assert n.y.x.y.p.y.p.p.t.txt == "i"