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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: H = None
        self.y: H = None
        self.v: A = None
        self.u: D = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.x: H = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.o: B = None
        self.x: J = None
        self.q: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: H = None
        self.y: H = None
        self.v: A = None
        self.u: D = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.x: H = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.o: B = None
        self.x: J = None
        self.q: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: F = None
        self.txt = txt

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

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