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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

m = A("m")
e = B("e")
f = C("f")
i = D("i")
a = E("a")
j = F("j")
h = G("h")
c = H("c")

m.s = i
m.p = h
m.o = h
e.u = i
e.p = a
e.x = j
f.y = c
f.t = a
f.u = h
f.q = e
i.z = a
i.r = h
a.v = m
a.q = f
a.t = c
a.o = i
j.p = f
j.z = h
j.r = m
h.w = a
h.v = j
h.r = e
h.u = m
c.p = f
c.o = i
assert f.y.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

m = A("m")
e = B("e")
f = C("f")
i = D("i")
a = E("a")
j = F("j")
h = G("h")
c = H("c")

m.s = i
m.p = h
m.o = h
e.u = i
e.p = a
e.x = j
f.y = c
f.t = a
f.u = h
f.q = e
i.z = a
i.r = h
a.v = m
a.q = f
a.t = c
a.o = i
j.p = f
j.z = h
j.r = m
h.w = a
h.v = j
h.r = e
h.u = m
c.p = f
c.o = i
assert f.y.o.z.txt == "a"