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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.v: C = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

l = A("l")
k = B("k")
c = C("c")
m = D("m")
n = E("n")
j = E("j")
h = C("h")
f = E("f")
d = B("d")

l.t = c
l.w = d
k.w = l
c.o = j
m.x = l
m.t = f
m.p = f
m.u = d
n.t = m
n.r = c
n.v = h
n.u = j
n.w = d
j.t = m
j.r = h
j.v = c
j.u = n
j.w = k
h.o = n
f.t = m
f.r = c
f.v = h
f.u = n
f.w = k
d.w = l
assert c.o.u.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.v: C = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

l = A("l")
k = B("k")
c = C("c")
m = D("m")
n = E("n")
j = E("j")
h = C("h")
f = E("f")
d = B("d")

l.t = c
l.w = d
k.w = l
c.o = j
m.x = l
m.t = f
m.p = f
m.u = d
n.t = m
n.r = c
n.v = h
n.u = j
n.w = d
j.t = m
j.r = h
j.v = c
j.u = n
j.w = k
h.o = n
f.t = m
f.r = c
f.v = h
f.u = n
f.w = k
d.w = l
assert c.o.u.r.o.txt == "j"