class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: F = None
        self.r: C = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: I = None
        self.v: I = None
        self.y: B = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: B = None
        self.r: B = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: I = None
        self.v: I = None
        self.y: B = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: B = None
        self.r: B = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

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

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