class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: H = None
        self.t: H = None
        self.p: D = None
        self.x: H = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: I = None
        self.s: I = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.y: C = None
        self.x: D = None
        self.q: D = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: H = None
        self.t: H = None
        self.p: D = None
        self.x: H = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: I = None
        self.s: I = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.y: C = None
        self.x: D = None
        self.q: D = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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