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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

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

j = A("j")
d = B("d")
a = C("a")
i = D("i")
e = B("e")
c = B("c")
k = B("k")
n = A("n")
f = B("f")
b = B("b")

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

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

j = A("j")
d = B("d")
a = C("a")
i = D("i")
e = B("e")
c = B("c")
k = B("k")
n = A("n")
f = B("f")
b = B("b")

j.p = a
j.t = a
j.o = n
j.u = i
d.y = j
d.x = n
a.o = n
a.v = n
a.s = j
i.x = k
e.y = n
e.x = n
c.y = n
c.x = j
k.y = j
k.x = j
n.p = a
n.t = a
n.o = j
n.u = i
f.y = n
f.x = j
b.y = j
b.x = n
assert k.x.t.v.u.x.y.t.s.o.p.txt == "a"