class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: B = None
        self.r: J = None
        self.w: B = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: H = None
        self.x: D = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: H = None
        self.s: D = None
        self.q: E = None
        self.v: H = None
        self.r: C = None
        self.y: D = None
        self.o: G = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: H = None
        self.x: D = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.w: D = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: H = None
        self.s: D = None
        self.q: E = None
        self.v: H = None
        self.r: C = None
        self.y: D = None
        self.o: G = None
        self.t: D = None
        self.txt = txt

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

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