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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: H = None
        self.r: C = None
        self.t: G = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.q: A = None
        self.x: E = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: H = None
        self.r: C = None
        self.t: G = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.q: A = None
        self.x: E = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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