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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: J = None
        self.s: I = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: B = None
        self.t: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: I = None
        self.o: B = None
        self.x: H = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: J = None
        self.s: I = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: B = None
        self.t: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: I = None
        self.o: B = None
        self.x: H = None
        self.z: F = None
        self.txt = txt

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

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