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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: A = None
        self.o: F = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: E = None
        self.w: G = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: H = None
        self.y: E = None
        self.r: I = None
        self.u: J = None
        self.x: F = None
        self.t: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: J = None
        self.t: E = None
        self.s: C = None
        self.p: J = None
        self.v: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: A = None
        self.o: F = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: E = None
        self.w: G = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: H = None
        self.y: E = None
        self.r: I = None
        self.u: J = None
        self.x: F = None
        self.t: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: J = None
        self.t: E = None
        self.s: C = None
        self.p: J = None
        self.v: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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