class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: F = None
        self.q: D = None
        self.p: G = None
        self.r: C = None
        self.t: E = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.y: A = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: F = None
        self.q: D = None
        self.p: G = None
        self.r: C = None
        self.t: E = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.y: A = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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