class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.z: A = None
        self.p: B = None
        self.q: J = None
        self.w: F = None
        self.o: C = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.z: A = None
        self.p: B = None
        self.q: J = None
        self.w: F = None
        self.o: C = None
        self.y: G = None
        self.txt = txt

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

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

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

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