class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: D = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: A = None
        self.z: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: A = None
        self.z: B = None
        self.y: E = None
        self.txt = txt

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

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