class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: H = None
        self.w: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: H = None
        self.p: H = None
        self.v: E = None
        self.r: F = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: H = None
        self.p: H = None
        self.v: E = None
        self.r: F = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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