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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.q: B = None
        self.u: D = None
        self.r: D = None
        self.z: B = None
        self.txt = txt

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

i.q = j
j.r = a
j.q = d
j.s = n
n.q = i
n.y = d
n.u = d
n.s = b
n.r = m
b.z = n
b.w = j
a.t = i
a.r = m
a.s = l
a.x = n
m.v = l
m.w = n
d.w = b
d.u = b
d.r = b
d.t = a
d.q = j
d.z = j
k.z = n
k.w = j
l.v = m
l.w = n
assert n.s.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.q: B = None
        self.u: D = None
        self.r: D = None
        self.z: B = None
        self.txt = txt

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

i.q = j
j.r = a
j.q = d
j.s = n
n.q = i
n.y = d
n.u = d
n.s = b
n.r = m
b.z = n
b.w = j
a.t = i
a.r = m
a.s = l
a.x = n
m.v = l
m.w = n
d.w = b
d.u = b
d.r = b
d.t = a
d.q = j
d.z = j
k.z = n
k.w = j
l.v = m
l.w = n
assert n.s.z.r.txt == "m"