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

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

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: J = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: J = None
        self.s: G = None
        self.w: I = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.z: H = None
        self.o: D = None
        self.s: F = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.o: I = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.v: J = None
        self.x: B = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: J = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: J = None
        self.s: G = None
        self.w: I = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.z: H = None
        self.o: D = None
        self.s: F = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.o: I = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.v: J = None
        self.x: B = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

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

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

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