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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.txt = txt

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

g.x = d
g.t = d
k.v = b
k.w = g
k.o = d
k.p = d
d.o = e
b.z = d
n.w = e
n.t = d
e.w = n
e.t = d
f.z = d
l.v = f
l.w = g
l.o = d
l.p = d
m.z = d
assert l.w.x.o.w.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.txt = txt

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

g.x = d
g.t = d
k.v = b
k.w = g
k.o = d
k.p = d
d.o = e
b.z = d
n.w = e
n.t = d
e.w = n
e.t = d
f.z = d
l.v = f
l.w = g
l.o = d
l.p = d
m.z = d
assert l.w.x.o.w.t.o.txt == "e"