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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: H = None
        self.x: E = None
        self.v: F = None
        self.y: G = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.r: G = None
        self.u: H = None
        self.v: F = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: H = None
        self.w: G = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: H = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: E = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: H = None
        self.x: E = None
        self.v: F = None
        self.y: G = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.r: G = None
        self.u: H = None
        self.v: F = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: H = None
        self.w: G = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: H = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: E = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

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