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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.p: F = None
        self.u: B = None
        self.r: A = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.p: B = None
        self.z: I = None
        self.r: B = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.v: H = None
        self.u: H = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.v: D = None
        self.x: E = None
        self.txt = txt

n = A("n")
g = B("g")
a = C("a")
l = D("l")
b = E("b")
f = F("f")
e = G("e")
d = H("d")
j = I("j")
h = G("h")

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.p: F = None
        self.u: B = None
        self.r: A = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.p: B = None
        self.z: I = None
        self.r: B = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.v: H = None
        self.u: H = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.v: D = None
        self.x: E = None
        self.txt = txt

n = A("n")
g = B("g")
a = C("a")
l = D("l")
b = E("b")
f = F("f")
e = G("e")
d = H("d")
j = I("j")
h = G("h")

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