class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: G = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.w: A = None
        self.s: G = None
        self.u: H = None
        self.o: G = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: B = None
        self.p: H = None
        self.z: B = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.x: H = None
        self.y: G = None
        self.t: G = None
        self.z: G = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
c = C("c")
b = D("b")
n = E("n")
j = F("j")
h = G("h")
g = H("g")

e.t = j
e.w = h
e.q = f
f.q = c
f.y = c
f.w = e
f.s = h
f.o = h
f.r = h
f.v = h
f.u = g
c.x = j
c.y = f
c.z = f
c.p = g
c.r = g
b.r = f
b.s = n
b.x = g
b.q = g
b.y = h
b.t = h
b.z = h
n.r = g
n.t = g
n.w = e
n.v = h
n.s = h
n.o = b
n.q = f
n.z = j
j.z = c
h.q = n
h.s = n
h.t = b
h.x = b
h.u = f
h.y = f
h.w = e
h.p = j
g.v = n
assert h.w.t.z.x.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: G = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.w: A = None
        self.s: G = None
        self.u: H = None
        self.o: G = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: B = None
        self.p: H = None
        self.z: B = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.x: H = None
        self.y: G = None
        self.t: G = None
        self.z: G = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
c = C("c")
b = D("b")
n = E("n")
j = F("j")
h = G("h")
g = H("g")

e.t = j
e.w = h
e.q = f
f.q = c
f.y = c
f.w = e
f.s = h
f.o = h
f.r = h
f.v = h
f.u = g
c.x = j
c.y = f
c.z = f
c.p = g
c.r = g
b.r = f
b.s = n
b.x = g
b.q = g
b.y = h
b.t = h
b.z = h
n.r = g
n.t = g
n.w = e
n.v = h
n.s = h
n.o = b
n.q = f
n.z = j
j.z = c
h.q = n
h.s = n
h.t = b
h.x = b
h.u = f
h.y = f
h.w = e
h.p = j
g.v = n
assert h.w.t.z.x.z.y.txt == "f"