class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.v: E = None
        self.u: F = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.p: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: E = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: C = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

i = A("i")
k = B("k")
g = C("g")
a = D("a")
f = E("f")
l = F("l")
h = G("h")
c = G("c")
n = A("n")

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.p: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: E = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: C = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

i = A("i")
k = B("k")
g = C("g")
a = D("a")
f = E("f")
l = F("l")
h = G("h")
c = G("c")
n = A("n")

i.r = n
i.y = a
i.p = a
i.q = a
i.v = f
i.u = l
k.z = n
k.v = f
k.y = g
g.x = i
g.y = i
g.v = f
g.p = c
a.o = k
a.r = f
a.z = l
a.x = g
f.w = k
f.z = k
l.p = f
h.y = c
h.s = g
h.p = k
h.o = i
c.y = h
c.s = g
c.p = k
c.o = n
n.r = i
n.y = a
n.p = a
n.q = a
n.v = f
n.u = l
assert g.p.o.v.z.txt == "k"