class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.w: 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.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

h.q = g
h.r = c
h.w = b
n.w = h
g.q = j
k.z = g
k.o = n
k.s = h
k.x = j
j.r = c
j.o = c
j.z = b
j.v = b
j.x = n
j.q = g
c.o = k
c.v = g
c.s = g
b.p = n
b.u = n
b.x = g
e.z = g
e.o = n
e.s = h
e.x = j
assert g.q.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.w: 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.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

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