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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: E = None
        self.p: G = None
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: C = None
        self.q: E = None
        self.t: E = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: E = None
        self.p: G = None
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: C = None
        self.q: E = None
        self.t: E = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

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