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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: J = None
        self.z: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.p: I = None
        self.u: I = None
        self.q: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: H = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: J = None
        self.z: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.p: I = None
        self.u: I = None
        self.q: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: H = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

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