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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.v: B = 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.p: A = None
        self.y: D = None
        self.txt = txt

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

n.t = d
n.v = i
n.o = i
n.s = k
l.o = k
l.r = k
l.v = j
l.t = g
d.o = g
k.p = n
k.y = g
j.o = k
j.r = g
j.t = g
j.v = l
g.p = n
g.y = k
i.t = d
i.v = n
i.o = n
i.s = k
m.o = k
m.r = k
m.v = j
m.t = g
assert j.o.y.p.t.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: A = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.v: B = 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.p: A = None
        self.y: D = None
        self.txt = txt

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

n.t = d
n.v = i
n.o = i
n.s = k
l.o = k
l.r = k
l.v = j
l.t = g
d.o = g
k.p = n
k.y = g
j.o = k
j.r = g
j.t = g
j.v = l
g.p = n
g.y = k
i.t = d
i.v = n
i.o = n
i.s = k
m.o = k
m.r = k
m.v = j
m.t = g
assert j.o.y.p.t.o.p.txt == "n"