class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.s: H = None
        self.w: B = None
        self.q: G = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: F = None
        self.x: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.s: H = None
        self.w: B = None
        self.q: G = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: F = None
        self.x: D = None
        self.t: A = None
        self.txt = txt

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

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

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