class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.z: B = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: F = None
        self.w: B = None
        self.x: I = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: C = None
        self.z: F = None
        self.t: A = None
        self.y: H = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.z: B = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: F = None
        self.w: B = None
        self.x: I = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: C = None
        self.z: F = None
        self.t: A = None
        self.y: H = None
        self.r: E = None
        self.txt = txt

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

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