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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

n = A("n")
j = B("j")
c = C("c")
f = D("f")
b = E("b")
l = D("l")
h = E("h")
e = A("e")

n.v = l
j.u = c
j.o = b
c.w = f
c.x = j
f.v = c
f.p = c
f.w = c
f.u = l
b.v = e
b.z = c
b.y = h
l.v = c
l.p = c
l.w = c
l.u = f
h.v = n
h.z = c
h.y = b
e.v = f
assert e.v.v.x.u.x.u.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

n = A("n")
j = B("j")
c = C("c")
f = D("f")
b = E("b")
l = D("l")
h = E("h")
e = A("e")

n.v = l
j.u = c
j.o = b
c.w = f
c.x = j
f.v = c
f.p = c
f.w = c
f.u = l
b.v = e
b.z = c
b.y = h
l.v = c
l.p = c
l.w = c
l.u = f
h.v = n
h.z = c
h.y = b
e.v = f
assert e.v.v.x.u.x.u.x.u.txt == "c"