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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: I = None
        self.y: I = None
        self.w: C = None
        self.x: I = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: F = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.s: F = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: G = None
        self.z: I = None
        self.o: H = None
        self.s: G = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: E = None
        self.p: C = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: C = None
        self.x: G = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: I = None
        self.y: I = None
        self.w: C = None
        self.x: I = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: F = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.s: F = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: G = None
        self.z: I = None
        self.o: H = None
        self.s: G = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: E = None
        self.p: C = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: C = None
        self.x: G = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

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