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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: A = None
        self.x: C = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

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

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

f.w = b
f.v = b
f.r = m
f.u = m
f.t = l
m.t = b
m.v = i
l.s = f
l.t = f
l.y = e
l.o = e
l.x = m
e.z = b
e.u = f
e.x = l
e.w = g
e.q = g
i.y = m
i.w = e
g.z = b
g.u = f
g.x = l
g.w = e
g.q = e
b.y = m
b.w = g
assert e.x.x.t.w.w.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: B = None
        self.u: B = None
        self.t: C = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: A = None
        self.x: C = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

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

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

f.w = b
f.v = b
f.r = m
f.u = m
f.t = l
m.t = b
m.v = i
l.s = f
l.t = f
l.y = e
l.o = e
l.x = m
e.z = b
e.u = f
e.x = l
e.w = g
e.q = g
i.y = m
i.w = e
g.z = b
g.u = f
g.x = l
g.w = e
g.q = e
b.y = m
b.w = g
assert e.x.x.t.w.w.x.o.txt == "e"