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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: F = None
        self.t: D = None
        self.s: G = None
        self.w: G = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: F = None
        self.p: B = None
        self.w: A = None
        self.s: B = None
        self.u: B = None
        self.o: H = None
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.o: F = None
        self.r: C = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
d = D("d")
f = E("f")
m = F("m")
g = G("g")
e = H("e")
a = C("a")

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: F = None
        self.t: D = None
        self.s: G = None
        self.w: G = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: F = None
        self.p: B = None
        self.w: A = None
        self.s: B = None
        self.u: B = None
        self.o: H = None
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.o: F = None
        self.r: C = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
d = D("d")
f = E("f")
m = F("m")
g = G("g")
e = H("e")
a = C("a")

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