class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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