class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: B = None
        self.x: B = None
        self.z: D = None
        self.w: B = None
        self.p: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.v: H = None
        self.t: B = None
        self.o: D = None
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.v: I = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: H = None
        self.p: E = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.y: E = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.v: H = None
        self.t: B = None
        self.o: D = None
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.v: I = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: H = None
        self.p: E = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.y: E = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

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

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