class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.o: B = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: F = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: H = None
        self.txt = txt

k = A("k")
f = B("f")
m = C("m")
n = D("n")
j = E("j")
g = F("g")
d = G("d")
b = H("b")
l = I("l")
e = A("e")

k.p = b
k.x = g
k.r = d
f.p = d
m.p = j
m.z = b
n.x = l
n.u = l
n.w = b
n.r = f
n.z = k
j.p = n
j.v = n
g.s = j
d.z = f
d.o = f
d.y = n
d.q = m
b.t = m
b.y = g
b.r = j
l.s = m
l.y = b
e.p = b
e.x = g
e.r = d
assert e.p.t.z.r.v.w.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.o: B = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: F = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: H = None
        self.txt = txt

k = A("k")
f = B("f")
m = C("m")
n = D("n")
j = E("j")
g = F("g")
d = G("d")
b = H("b")
l = I("l")
e = A("e")

k.p = b
k.x = g
k.r = d
f.p = d
m.p = j
m.z = b
n.x = l
n.u = l
n.w = b
n.r = f
n.z = k
j.p = n
j.v = n
g.s = j
d.z = f
d.o = f
d.y = n
d.q = m
b.t = m
b.y = g
b.r = j
l.s = m
l.y = b
e.p = b
e.x = g
e.r = d
assert e.p.t.z.r.v.w.r.v.txt == "n"