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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.q: A = None
        self.w: C = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.r: B = None
        self.t: H = None
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: A = None
        self.y: G = None
        self.z: B = None
        self.r: F = None
        self.p: C = None
        self.o: D = None
        self.v: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.q: A = None
        self.w: C = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.r: B = None
        self.t: H = None
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: A = None
        self.y: G = None
        self.z: B = None
        self.r: F = None
        self.p: C = None
        self.o: D = None
        self.v: G = None
        self.txt = txt

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

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

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