class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

e.u = l
m.s = g
m.p = l
m.w = e
f.o = g
f.y = e
b.t = g
b.p = f
b.y = d
b.z = i
g.y = k
g.w = j
i.o = g
i.y = e
k.s = g
k.p = l
k.w = j
j.u = l
d.s = g
d.p = b
d.w = j
l.t = g
l.p = f
l.y = m
l.z = i
assert j.u.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

e.u = l
m.s = g
m.p = l
m.w = e
f.o = g
f.y = e
b.t = g
b.p = f
b.y = d
b.z = i
g.y = k
g.w = j
i.o = g
i.y = e
k.s = g
k.p = l
k.w = j
j.u = l
d.s = g
d.p = b
d.w = j
l.t = g
l.p = f
l.y = m
l.z = i
assert j.u.z.o.txt == "g"