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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: F = None
        self.r: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
h = C("h")
a = D("a")
c = E("c")
d = F("d")
i = G("i")

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: F = None
        self.r: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
h = C("h")
a = D("a")
c = E("c")
d = F("d")
i = G("i")

n.s = j
n.z = a
n.x = i
j.w = n
h.x = a
h.v = d
h.r = j
h.w = c
a.s = i
c.y = j
d.s = j
d.t = c
d.r = h
i.v = c
i.w = j
i.q = j
i.y = n
i.p = h
assert c.y.w.x.v.y.w.z.txt == "a"