class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: H = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.y: D = None
        self.v: H = None
        self.p: J = None
        self.o: I = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.s: I = None
        self.x: F = None
        self.r: G = None
        self.v: B = None
        self.q: I = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.v: G = None
        self.q: C = None
        self.p: H = None
        self.u: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: E = None
        self.u: J = None
        self.o: E = None
        self.w: A = None
        self.q: J = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: G = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: C = None
        self.y: D = None
        self.v: H = None
        self.p: J = None
        self.o: I = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: B = None
        self.s: I = None
        self.x: F = None
        self.r: G = None
        self.v: B = None
        self.q: I = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.v: G = None
        self.q: C = None
        self.p: H = None
        self.u: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: E = None
        self.u: J = None
        self.o: E = None
        self.w: A = None
        self.q: J = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: G = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

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

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