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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: F = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.v: G = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: F = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.v: G = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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