class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: J = None
        self.u: J = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: H = None
        self.v: I = None
        self.s: E = None
        self.o: C = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: C = None
        self.v: I = None
        self.o: E = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: J = None
        self.u: J = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: H = None
        self.v: I = None
        self.s: E = None
        self.o: C = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: C = None
        self.v: I = None
        self.o: E = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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