class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

k = A("k")
l = B("l")
m = C("m")
e = D("e")
j = E("j")
f = B("f")
g = D("g")
b = C("b")

k.r = j
l.o = m
m.z = k
m.w = k
m.r = l
e.u = g
e.o = l
e.r = j
j.v = g
j.r = g
j.o = b
j.y = e
f.o = m
g.u = e
g.o = l
g.r = j
b.z = k
b.w = k
b.r = f
assert l.o.w.r.v.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

k = A("k")
l = B("l")
m = C("m")
e = D("e")
j = E("j")
f = B("f")
g = D("g")
b = C("b")

k.r = j
l.o = m
m.z = k
m.w = k
m.r = l
e.u = g
e.o = l
e.r = j
j.v = g
j.r = g
j.o = b
j.y = e
f.o = m
g.u = e
g.o = l
g.r = j
b.z = k
b.w = k
b.r = f
assert l.o.w.r.v.r.y.txt == "e"