class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.q: C = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

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

n.s = c
n.u = h
n.o = i
h.v = c
f.t = h
f.x = l
f.y = m
i.v = f
j.v = h
j.u = h
j.q = m
j.s = c
j.w = c
c.v = h
c.u = h
c.q = f
c.s = j
c.w = j
m.t = h
m.x = l
m.y = f
l.s = c
l.u = h
l.o = i
assert m.x.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.q: C = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

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

n.s = c
n.u = h
n.o = i
h.v = c
f.t = h
f.x = l
f.y = m
i.v = f
j.v = h
j.u = h
j.q = m
j.s = c
j.w = c
c.v = h
c.u = h
c.q = f
c.s = j
c.w = j
m.t = h
m.x = l
m.y = f
l.s = c
l.u = h
l.o = i
assert m.x.u.v.txt == "c"