class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: E = None
        self.s: E = None
        self.x: C = None
        self.z: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: G = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: G = None
        self.q: G = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: I = None
        self.y: D = None
        self.w: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: G = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: G = None
        self.q: G = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: I = None
        self.y: D = None
        self.w: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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