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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.u: C = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.u: C = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.txt = txt

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

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