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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: C = None
        self.y: F = None
        self.w: C = None
        self.p: G = None
        self.v: E = None
        self.s: G = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: C = None
        self.y: F = None
        self.w: C = None
        self.p: G = None
        self.v: E = None
        self.s: G = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

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

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