class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.o: A = None
        self.u: F = None
        self.p: H = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.u: H = None
        self.w: E = None
        self.o: C = None
        self.q: H = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.u: H = None
        self.w: E = None
        self.o: C = None
        self.q: H = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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