class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: B = None
        self.x: B = None
        self.u: D = None
        self.o: E = None
        self.p: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: A = None
        self.x: D = None
        self.u: D = None
        self.t: F = None
        self.o: D = None
        self.txt = txt

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

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

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

d.z = l
d.o = g
d.r = n
g.y = l
g.r = f
g.x = f
g.p = f
g.u = m
g.o = h
e.t = c
e.y = g
n.p = i
h.q = c
h.z = d
h.x = m
h.u = n
h.o = n
h.t = i
i.v = l
c.p = e
c.y = e
c.u = i
c.s = f
f.y = l
f.r = g
f.x = g
f.p = g
f.u = m
f.o = h
l.z = d
l.o = g
l.r = m
m.p = i
assert l.z.r.p.v.r.p.v.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: B = None
        self.x: B = None
        self.u: D = None
        self.o: E = None
        self.p: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: A = None
        self.x: D = None
        self.u: D = None
        self.t: F = None
        self.o: D = None
        self.txt = txt

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

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

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

d.z = l
d.o = g
d.r = n
g.y = l
g.r = f
g.x = f
g.p = f
g.u = m
g.o = h
e.t = c
e.y = g
n.p = i
h.q = c
h.z = d
h.x = m
h.u = n
h.o = n
h.t = i
i.v = l
c.p = e
c.y = e
c.u = i
c.s = f
f.y = l
f.r = g
f.x = g
f.p = g
f.u = m
f.o = h
l.z = d
l.o = g
l.r = m
m.p = i
assert l.z.r.p.v.r.p.v.r.p.txt == "i"