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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

j.z = m
j.u = m
j.y = k
j.r = g
j.v = g
i.o = k
k.x = a
k.q = i
n.x = k
n.w = k
n.v = g
a.p = j
m.z = j
m.r = j
m.p = k
m.s = g
m.q = i
g.p = m
g.r = i
g.s = i
g.t = k
g.y = n
g.u = a
g.q = a
assert j.y.q.o.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.r: G = None
        self.v: G = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

j.z = m
j.u = m
j.y = k
j.r = g
j.v = g
i.o = k
k.x = a
k.q = i
n.x = k
n.w = k
n.v = g
a.p = j
m.z = j
m.r = j
m.p = k
m.s = g
m.q = i
g.p = m
g.r = i
g.s = i
g.t = k
g.y = n
g.u = a
g.q = a
assert j.y.q.o.q.o.txt == "k"