class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: F = None
        self.t: G = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: D = None
        self.y: H = None
        self.x: G = None
        self.r: D = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: B = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: B = None
        self.p: I = None
        self.t: J = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: G = None
        self.w: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.s: I = None
        self.y: D = None
        self.o: J = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: E = None
        self.txt = txt

a = A("a")
g = B("g")
l = C("l")
b = D("b")
i = E("i")
n = F("n")
f = G("f")
k = H("k")
m = I("m")
c = J("c")

a.y = m
a.u = n
a.t = f
a.r = g
g.w = l
g.z = i
g.t = m
l.w = k
l.y = k
l.s = b
l.r = b
l.z = b
l.x = f
l.o = g
b.v = m
b.o = g
b.z = f
i.w = k
i.z = g
i.p = m
i.t = c
i.x = l
n.r = i
n.o = f
n.w = f
n.s = k
f.u = n
f.v = g
f.s = m
f.y = b
f.o = c
f.q = l
k.o = b
k.v = l
m.u = k
m.v = a
c.u = k
c.v = i
assert m.u.v.r.v.u.v.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: F = None
        self.t: G = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: D = None
        self.y: H = None
        self.x: G = None
        self.r: D = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: B = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: B = None
        self.p: I = None
        self.t: J = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: G = None
        self.w: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.s: I = None
        self.y: D = None
        self.o: J = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: E = None
        self.txt = txt

a = A("a")
g = B("g")
l = C("l")
b = D("b")
i = E("i")
n = F("n")
f = G("f")
k = H("k")
m = I("m")
c = J("c")

a.y = m
a.u = n
a.t = f
a.r = g
g.w = l
g.z = i
g.t = m
l.w = k
l.y = k
l.s = b
l.r = b
l.z = b
l.x = f
l.o = g
b.v = m
b.o = g
b.z = f
i.w = k
i.z = g
i.p = m
i.t = c
i.x = l
n.r = i
n.o = f
n.w = f
n.s = k
f.u = n
f.v = g
f.s = m
f.y = b
f.o = c
f.q = l
k.o = b
k.v = l
m.u = k
m.v = a
c.u = k
c.v = i
assert m.u.v.r.v.u.v.x.q.txt == "l"