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

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

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: G = None
        self.u: H = None
        self.w: H = None
        self.s: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: A = None
        self.s: F = None
        self.u: G = None
        self.p: D = None
        self.v: A = None
        self.y: A = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.txt = txt

f = A("f")
c = B("c")
i = C("i")
g = D("g")
j = E("j")
a = F("a")
e = G("e")
l = H("l")
n = I("n")

f.p = n
c.u = g
c.t = g
c.r = f
i.u = c
i.x = f
i.o = g
g.p = n
g.v = e
g.u = l
g.w = l
g.s = j
j.r = a
j.v = g
a.u = f
a.t = g
a.z = j
a.r = j
e.r = j
e.z = c
e.y = a
e.o = i
l.t = i
l.w = f
l.v = f
l.y = f
l.s = a
l.u = e
l.r = e
l.p = g
n.z = g
n.p = c
assert c.t.s.r.z.r.z.r.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: G = None
        self.u: H = None
        self.w: H = None
        self.s: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: A = None
        self.s: F = None
        self.u: G = None
        self.p: D = None
        self.v: A = None
        self.y: A = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.txt = txt

f = A("f")
c = B("c")
i = C("i")
g = D("g")
j = E("j")
a = F("a")
e = G("e")
l = H("l")
n = I("n")

f.p = n
c.u = g
c.t = g
c.r = f
i.u = c
i.x = f
i.o = g
g.p = n
g.v = e
g.u = l
g.w = l
g.s = j
j.r = a
j.v = g
a.u = f
a.t = g
a.z = j
a.r = j
e.r = j
e.z = c
e.y = a
e.o = i
l.t = i
l.w = f
l.v = f
l.y = f
l.s = a
l.u = e
l.r = e
l.p = g
n.z = g
n.p = c
assert c.t.s.r.z.r.z.r.r.v.txt == "g"