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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: E = None
        self.r: G = None
        self.p: F = None
        self.u: H = None
        self.q: I = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: H = None
        self.x: I = None
        self.s: A = None
        self.p: D = None
        self.w: C = None
        self.t: B = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: B = None
        self.q: F = None
        self.o: A = None
        self.u: I = None
        self.v: H = None
        self.p: E = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: E = None
        self.r: G = None
        self.p: F = None
        self.u: H = None
        self.q: I = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: H = None
        self.x: I = None
        self.s: A = None
        self.p: D = None
        self.w: C = None
        self.t: B = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: B = None
        self.q: F = None
        self.o: A = None
        self.u: I = None
        self.v: H = None
        self.p: E = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

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

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

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