class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: C = None
        self.t: G = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: E = None
        self.o: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: E = None
        self.o: B = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

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

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