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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.y: F = None
        self.p: H = None
        self.r: B = None
        self.t: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: D = None
        self.w: G = None
        self.u: A = None
        self.r: F = None
        self.z: H = None
        self.p: C = None
        self.o: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.y: F = None
        self.p: H = None
        self.r: B = None
        self.t: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: D = None
        self.w: G = None
        self.u: A = None
        self.r: F = None
        self.z: H = None
        self.p: C = None
        self.o: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

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

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