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

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

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

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

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

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

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

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

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

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

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