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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: H = None
        self.s: D = None
        self.v: E = None
        self.u: H = None
        self.t: I = None
        self.x: H = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: G = None
        self.u: G = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: H = None
        self.s: D = None
        self.v: E = None
        self.u: H = None
        self.t: I = None
        self.x: H = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: G = None
        self.u: G = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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