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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.v: H = None
        self.o: C = None
        self.q: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.v: H = None
        self.o: C = None
        self.q: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

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