class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: D = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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