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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: G = None
        self.s: A = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: E = None
        self.w: A = None
        self.r: B = None
        self.x: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: G = None
        self.s: A = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: E = None
        self.w: A = None
        self.r: B = None
        self.x: G = None
        self.txt = txt

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

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