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

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

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

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

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

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

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

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

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

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

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

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

j.t = g
j.s = b
j.v = d
j.y = m
g.w = f
d.t = a
d.u = k
d.z = e
d.o = g
k.x = d
k.y = m
k.r = j
k.v = a
a.y = g
f.x = d
f.y = j
f.r = j
f.v = a
e.t = a
e.u = f
e.z = b
e.o = g
b.t = a
b.u = k
b.z = d
b.o = g
m.t = g
m.s = e
m.v = d
m.y = j
assert g.w.x.u.v.y.w.txt == "f"