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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

n.q = j
n.r = j
n.x = l
n.o = i
n.y = i
n.z = b
g.y = n
l.x = b
l.y = b
l.q = i
l.p = g
l.s = d
h.q = i
h.s = i
i.p = b
i.o = b
i.x = h
i.q = m
b.z = l
b.t = j
j.y = b
j.q = i
j.t = i
m.x = b
m.y = b
m.q = i
m.p = g
m.s = d
d.q = i
d.s = i
assert n.z.z.s.q.o.t.txt == "j"