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

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

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: H = None
        self.x: H = None
        self.s: G = None
        self.p: A = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: D = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: H = None
        self.x: H = None
        self.s: G = None
        self.p: A = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: D = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

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

b.o = i
c.o = g
c.x = b
f.p = e
k.q = g
k.w = l
k.x = l
k.s = i
k.p = b
k.t = b
e.r = k
e.p = c
e.u = m
e.o = m
e.x = i
e.v = b
e.s = f
m.v = l
i.v = c
i.p = k
i.q = b
i.y = f
l.w = e
l.z = i
l.r = i
l.v = i
l.y = b
l.u = b
l.x = m
l.s = f
l.q = g
g.z = c
g.p = c
g.y = c
g.o = f
assert g.z.o.y.o.txt == "g"