class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: B = None
        self.w: D = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: F = None
        self.y: G = None
        self.w: J = None
        self.u: D = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: I = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.v: D = None
        self.z: B = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: F = None
        self.y: G = None
        self.w: J = None
        self.u: D = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: I = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.v: D = None
        self.z: B = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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