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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: B = None
        self.r: C = None
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

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

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

f.x = g
f.s = j
m.r = l
m.w = k
m.o = k
m.z = b
c.p = j
c.r = j
c.u = j
c.v = m
c.y = f
g.w = k
g.r = f
g.x = m
b.o = j
b.r = l
j.p = c
j.r = c
j.u = c
j.v = m
j.y = f
k.r = b
k.w = m
k.o = m
k.z = l
l.o = j
l.r = b
assert f.s.v.w.o.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: B = None
        self.r: C = None
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

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

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

f.x = g
f.s = j
m.r = l
m.w = k
m.o = k
m.z = b
c.p = j
c.r = j
c.u = j
c.v = m
c.y = f
g.w = k
g.r = f
g.x = m
b.o = j
b.r = l
j.p = c
j.r = c
j.u = c
j.v = m
j.y = f
k.r = b
k.w = m
k.o = m
k.z = l
l.o = j
l.r = b
assert f.s.v.w.o.w.z.txt == "l"