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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.s: A = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.p: G = None
        self.z: G = None
        self.txt = txt

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

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

j.s = m
j.x = n
j.v = g
j.r = g
j.p = a
l.p = f
l.v = f
l.s = j
l.r = g
n.x = m
g.q = m
m.w = j
m.z = n
m.r = b
h.q = j
h.o = f
h.p = b
h.z = b
b.q = l
b.z = l
b.p = m
b.u = j
b.s = j
a.q = j
a.o = h
a.p = b
a.z = b
f.q = j
f.o = a
f.p = b
f.z = b
assert g.q.z.x.r.u.x.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: C = None
        self.v: D = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.s: A = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.p: G = None
        self.z: G = None
        self.txt = txt

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

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

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