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

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

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

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

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

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

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

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

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

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

l.w = m
l.r = m
l.s = d
l.o = j
d.x = j
d.t = m
i.v = m
i.t = k
i.s = g
h.u = i
a.v = k
a.t = i
a.s = h
j.w = k
j.r = k
j.s = d
j.o = l
g.u = a
k.v = i
k.t = m
k.s = g
m.v = i
m.t = a
m.s = h
assert l.o.o.o.o.txt == "l"