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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: E = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: E = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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