class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.r: B = None
        self.v: E = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: E = None
        self.y: G = None
        self.q: H = None
        self.r: F = None
        self.x: D = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.z: G = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.t: B = None
        self.r: A = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: I = None
        self.q: I = None
        self.t: I = None
        self.u: G = None
        self.z: A = None
        self.x: D = None
        self.r: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.o: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: E = None
        self.y: G = None
        self.q: H = None
        self.r: F = None
        self.x: D = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.z: G = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.t: B = None
        self.r: A = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: I = None
        self.q: I = None
        self.t: I = None
        self.u: G = None
        self.z: A = None
        self.x: D = None
        self.r: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.o: F = None
        self.txt = txt

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

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