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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.p: F = None
        self.z: D = None
        self.u: B = None
        self.q: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.p: F = None
        self.z: D = None
        self.u: B = None
        self.q: F = None
        self.t: B = None
        self.txt = txt

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

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

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