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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.z: B = None
        self.u: B = None
        self.v: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: E = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: G = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.z: B = None
        self.u: B = None
        self.v: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: E = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: G = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

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

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