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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

k = A("k")
a = B("a")
j = C("j")
g = D("g")
d = A("d")
h = A("h")
l = D("l")
n = C("n")
f = B("f")

k.u = d
k.x = l
k.v = f
a.r = n
a.o = f
j.q = a
j.y = n
j.r = g
j.t = l
g.y = f
g.s = n
g.w = l
d.u = h
d.x = g
d.v = a
h.u = k
h.x = l
h.v = f
l.y = a
l.s = n
l.w = g
n.q = a
n.y = j
n.r = g
n.t = l
f.r = j
f.o = a
assert n.y.q.o.r.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

k = A("k")
a = B("a")
j = C("j")
g = D("g")
d = A("d")
h = A("h")
l = D("l")
n = C("n")
f = B("f")

k.u = d
k.x = l
k.v = f
a.r = n
a.o = f
j.q = a
j.y = n
j.r = g
j.t = l
g.y = f
g.s = n
g.w = l
d.u = h
d.x = g
d.v = a
h.u = k
h.x = l
h.v = f
l.y = a
l.s = n
l.w = g
n.q = a
n.y = j
n.r = g
n.t = l
f.r = j
f.o = a
assert n.y.q.o.r.t.s.txt == "n"