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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: B = None
        self.x: F = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.u: G = None
        self.s: G = None
        self.o: C = None
        self.t: E = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: B = None
        self.x: F = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.u: G = None
        self.s: G = None
        self.o: C = None
        self.t: E = None
        self.p: F = None
        self.txt = txt

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

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