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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.r: A = None
        self.t: C = None
        self.s: D = None
        self.q: B = None
        self.u: C = None
        self.txt = txt

m = A("m")
b = B("b")
i = C("i")
a = D("a")
k = E("k")
f = F("f")
n = G("n")
h = D("h")

m.q = n
m.x = n
m.p = i
m.u = f
b.r = n
b.v = f
b.q = f
b.u = m
b.w = i
b.z = k
i.p = f
i.q = f
i.s = n
i.y = b
i.w = a
i.r = k
i.z = k
a.v = i
a.q = n
k.u = m
f.v = i
n.x = m
n.r = m
n.y = a
n.t = i
n.u = i
n.s = h
n.q = b
h.v = i
h.q = n
assert h.q.u.r.u.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: C = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.r: A = None
        self.t: C = None
        self.s: D = None
        self.q: B = None
        self.u: C = None
        self.txt = txt

m = A("m")
b = B("b")
i = C("i")
a = D("a")
k = E("k")
f = F("f")
n = G("n")
h = D("h")

m.q = n
m.x = n
m.p = i
m.u = f
b.r = n
b.v = f
b.q = f
b.u = m
b.w = i
b.z = k
i.p = f
i.q = f
i.s = n
i.y = b
i.w = a
i.r = k
i.z = k
a.v = i
a.q = n
k.u = m
f.v = i
n.x = m
n.r = m
n.y = a
n.t = i
n.u = i
n.s = h
n.q = b
h.v = i
h.q = n
assert h.q.u.r.u.u.v.txt == "i"