class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: H = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.u: F = None
        self.o: C = None
        self.r: F = None
        self.y: A = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

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

c = A("c")
n = B("n")
b = C("b")
h = D("h")
k = E("k")
i = F("i")
l = G("l")
m = H("m")
f = I("f")

c.r = l
c.w = m
c.p = n
c.u = b
n.o = k
n.u = b
b.t = c
b.r = c
b.y = n
b.q = l
b.s = h
b.w = m
h.r = n
h.t = f
k.p = h
k.q = m
k.r = m
k.v = m
i.x = c
i.y = f
i.v = m
i.q = b
i.t = l
i.r = l
i.s = l
i.z = h
i.u = k
l.w = c
l.q = c
l.x = c
l.v = h
l.s = i
l.t = n
m.z = k
m.w = h
m.q = h
m.t = h
m.u = i
m.r = i
m.o = b
m.y = c
f.r = i
assert k.p.t.r.q.r.w.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: H = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.u: F = None
        self.o: C = None
        self.r: F = None
        self.y: A = None
        self.q: D = None
        self.t: D = None
        self.txt = txt

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

c = A("c")
n = B("n")
b = C("b")
h = D("h")
k = E("k")
i = F("i")
l = G("l")
m = H("m")
f = I("f")

c.r = l
c.w = m
c.p = n
c.u = b
n.o = k
n.u = b
b.t = c
b.r = c
b.y = n
b.q = l
b.s = h
b.w = m
h.r = n
h.t = f
k.p = h
k.q = m
k.r = m
k.v = m
i.x = c
i.y = f
i.v = m
i.q = b
i.t = l
i.r = l
i.s = l
i.z = h
i.u = k
l.w = c
l.q = c
l.x = c
l.v = h
l.s = i
l.t = n
m.z = k
m.w = h
m.q = h
m.t = h
m.u = i
m.r = i
m.o = b
m.y = c
f.r = i
assert k.p.t.r.q.r.w.o.y.txt == "n"