class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: H = None
        self.w: D = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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