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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.z: A = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.z: A = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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