class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: A = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: A = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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