class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: E = None
        self.u: E = None
        self.v: F = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: A = None
        self.s: G = None
        self.t: F = None
        self.o: E = None
        self.p: H = None
        self.x: I = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: A = None
        self.s: G = None
        self.t: F = None
        self.o: E = None
        self.p: H = None
        self.x: I = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

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

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