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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.p: G = None
        self.r: I = None
        self.s: E = None
        self.t: I = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: A = None
        self.x: I = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.p: G = None
        self.r: I = None
        self.s: E = None
        self.t: I = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: A = None
        self.x: I = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

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