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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: I = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = 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.p: H = None
        self.v: G = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

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

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

e.o = l
e.p = l
e.t = b
e.w = n
m.s = e
m.x = l
m.t = g
m.o = b
i.r = k
i.w = k
g.u = b
k.s = g
b.p = n
b.v = d
b.w = d
b.t = e
d.o = i
d.s = k
n.o = g
l.x = k
assert i.r.s.u.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: F = None
        self.w: H = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: I = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = 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.p: H = None
        self.v: G = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

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

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

e.o = l
e.p = l
e.t = b
e.w = n
m.s = e
m.x = l
m.t = g
m.o = b
i.r = k
i.w = k
g.u = b
k.s = g
b.p = n
b.v = d
b.w = d
b.t = e
d.o = i
d.s = k
n.o = g
l.x = k
assert i.r.s.u.p.o.txt == "g"