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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: F = None
        self.w: A = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: F = None
        self.w: A = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

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

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